using System;
using System.Collections.Generic;
using System.Text;
using Umdf.ComInterop;
using System.IO;

namespace Umdf.SideShow.Scf.Events
{
    public class ScfContextMenuEvent : ScfEvent
    {
        private uint _previousItemId;
        private uint _menuPage;
        private uint _menuItemId;

        public ScfContextMenuEvent(Guid applicationId, Guid endpointId, uint previousPage, uint targetPage, uint previousItemId, uint menuPage, uint menuItemId)
            : base(applicationId, endpointId, (int) SideShowEvents.SCF_EVENT_IDS.SCF_EVENT_CONTEXTMENU, previousPage, targetPage)
        {
            _previousItemId = previousItemId;
            _menuPage = menuPage;
            _menuItemId = menuItemId;
        }

        public uint PreviousItemId
        {
            get { return _previousItemId; }
        }

        public uint MenuPage
        {
            get { return _menuPage; }
        }

        public uint MenuItemId
        {
            get { return _menuItemId; }
        }

        protected override int EventDataSize
        {
            get { return base.EventDataSize + 12; }
        }

        protected override void WriteEventData(System.IO.Stream s)
        {
            BinaryWriter writer = new BinaryWriter(s);
            writer.Write(_previousItemId);
            writer.Write(_menuPage);
            writer.Write(_menuItemId);
        }

        
    }
}
